package com.ycz;

import com.ycz.extend.MyBeanPostProcessor;
import com.ycz.service.UserService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author ycz
 * @date 2021/6/8
 * @description TODO
 *
 */
public class BeanApplication {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
        applicationContext.register(UserService.class);
        applicationContext.register(MyBeanPostProcessor.class);
        applicationContext.refresh();
        UserService userService = applicationContext.getBean("userService", UserService.class);
        userService.print();
        System.out.println(userService.getUser().toString());
    }

}
